/**
 * app.css v1.2
 * 这是一个基于app的移动端UI框架
 * 作者：徐竣豪
 * 日期：2025年6月16日
 */

/*徐竣豪 Start*/
/**
 * 基础样式
 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f7f8fa;
}

ul {
  list-style: none;
}

p {
  font-size: 14px;
  color: #bbb;
}
i {
  font-style: normal;
}
a {
  text-decoration: none;
  color: #000;
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("../fonts/app.woff2");
}
/* Font Awesome Solid 图标 */

.app-icon::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.app-password-wrapper {
  position: relative;
  margin: 10px 0;
}

.app-password-eye-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

.app-password-eye-icon::before {
  content: "\f06e";
}

.app-password-eye-icon.show-password::before {
  content: "\f070";
}

.app-home-icon::before {
  content: "\f015";
}

.app-user-icon::before {
  content: "\f007";
}

.app-arrow-left-icon::before {
  content: "\f053";
}

.app-bars-icon::before {
  content: "\f0c9";
}
.app-search-icon::before {
  content: "\f002";
}
.app-cog-icon::before {
  content: "\f013";
}
.app-envelope-icon::before {
  content: "\f0e0";
}
.app-heart-icon::before {
  content: "\f004";
}
.app-star-icon::before {
  content: "\f005";
}
.app-check-icon::before {
  content: "\f00c";
}
.app-times-icon::before {
  content: "\f00d";
}
.app-plus-icon::before {
  content: "\f067";
}
/* 添加更多图标... */

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea {
  width: 100%;
  border: 1px solid #ccc;
  outline: none;
  padding: 10px;
}

button,
input[type="button"],
input[type="submit"],
.app-btn {
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #fff;
  border-radius: 6px;
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
.app-btn:active {
  transform: scale(0.98);
  background-color: #f0f0f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

.app-btn-primary:active {
  background-color: #0069d9;
  color: rgba(255, 255, 255, 0.9);
}

.app-btn-success:active {
  background-color: #218838;
  color: rgba(255, 255, 255, 0.9);
}

.app-btn-danger:active {
  background-color: #c82333;
  color: rgba(255, 255, 255, 0.9);
}

.app-btn-warning:active {
  background-color: #e0a800;
  color: rgba(0, 0, 0, 0.9);
}

button:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
.app-btn:focus {
  transition: background-color 0.15s ease;
}

.app-btn-block {
  width: 100%;
}

.app-btn-primary {
  background-color: #007bff;
  color: #fff;
}

.app-btn-success {
  background-color: #28a745;
  color: #fff;
}

.app-btn-danger {
  background-color: #dc3545;
  color: #fff;
}

.app-btn-warning {
  background-color: #ffc107;
  color: #fff;
}
/* 遮罩层 */
.app-mask {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  opacity: 0;
  background-color: gray;
  transition: opacity 0.3s ease;
}
.app-mask.show {
  display: block;
  opacity: 0.5;
}
.app-mask.hide {
  opacity: 0;
}

/* 弹出层 */
.app-pop {
  display: none;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 40vh;
  z-index: 999;
  background-color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  border-radius: 8px 8px 0 0;
  overflow-y: auto;
}
.app-pop.show {
  display: block;
  transform: translateY(0);
}
.app-pop.hide {
  bottom: -300px;
}

.app-scroll-content {
  /* 禁止换行 */
  white-space: nowrap;
  /* 自动显示 */
  overflow-x: auto;
  /* 滚动回弹 */
  -webkit-overflow-scrolling: touch;
  /* 扩大容量 */
  margin-bottom: -20;
  padding-bottom: -20;
  scrollbar-width: none;
  background-color: #f7f8fa;
}

.app-scroll-content::-webkit-scrollbar {
  /* 不显示 */
  display: none;
}

.app-scroll-item {
  display: inline-block;
  width: 100px;
  height: 48px;
  line-height: 48px;
  text-align: center;
}

.app-scroll-content .app-active {
  color: #007bff;
}

.app-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.app-bottom-bar .app-active {
  color: #007bff;
}

.app-bottom-bar > .app-bottom-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-bottom-bar-text {
  font-size: 13px;
}

/* 轮播图容器 */
.app-carousel {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

/* 轮播项 */
.carousel-item {
  position: absolute;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.carousel-item > img {
  width: 100%;
  height: 100%;
}

/* 指示器 */
.carousel-indicators {
  position: absolute;
  bottom: 10px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.carousel-indicator {
  width: 8px;
  height: 8px;
  margin: 0 4px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
}

.carousel-indicator.app-active {
  background-color: #fff;
}

.app-ellipsis {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  /* 控制显示行数 */
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  /* 需要设置行高 */
  max-height: calc(1.5em * 2);
  /* 行高*行数 */
}
.app-ellipsis-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  /* 控制显示行数 */
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  /* 需要设置行高 */
  max-height: calc(1.5em * 2);
  /* 行高*行数 */
}

.app-header {
  height: 42px;
  display: flex;
  align-items: center;
  background-color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.app-header .app-header-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

.app-header .app-header-back {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 20px;
}

.app-main {
  padding-top: 42px;
  padding-bottom: 50px;
}

/* 进度条 */
.app-progress {
  height: 8px;
  background-color: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin: 15px 0;
}

.app-progress-bar {
  height: 100%;
  background-color: #3498db;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* 开关 */
.app-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.app-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.app-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.app-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .app-slider {
  background-color: #2ecc71;
}

input:checked + .app-slider:before {
  transform: translateX(24px);
}

.app-checkbox-group,
.app-radio-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.app-checkbox-group input,
.app-radio-group input {
  margin-right: 10px;
}

/* 徽章 */
.app-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.app-badge-primary {
  background-color: #3498db;
  color: white;
}

.app-badge-secondary {
  background-color: #2ecc71;
  color: white;
}

.app-badge-warning {
  background-color: #f39c12;
  color: white;
}

/* 标签 */
.app-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  background: #ecf0f1;
  margin: 2px;
  font-size: 0.85rem;
}

.app-tag-primary {
  background-color: #3498db;
  color: white;
}

.app-tag-secondary {
  background-color: #2ecc71;
  color: white;
}

/* 加载指示器 */
.app-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #3498db;
  animation: spin 1s linear infinite;
}

/* 下拉刷新样式 */
.app-pull-refresh {
  position: relative;
  height: 60px;
  margin-top: -60px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.app-pull-refresh .refresh-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding-top: 10px;
}

.app-pull-refresh .refresh-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
  transition: transform 0.3s ease;
}

.app-pull-refresh .refresh-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 123, 255, 0.2);
  border-top: 3px solid #007bff;
  border-radius: 50%;
  margin-bottom: 6px;
  animation: spin 1s linear infinite;
  /* display: none; */
}

/* 上拉加载样式 */
.app-pull-load {
  padding: 15px 0;
  color: #999;
  font-size: 14px;
  display: none;
}

.app-pull-load .load-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-pull-load .load-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 123, 255, 0.2);
  border-top: 3px solid #007bff;
  border-radius: 50%;
  margin-bottom: 6px;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

/* 下拉刷新动画 */
@keyframes pullRefresh {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 加载指示器样式 */
.app-pull-load .app-spinner {
  border: 8px solid rgba(0, 0, 0, 0.1);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* app-toast消息提示 */
.app-toast {
  position: fixed;
  background: rgba(60, 60, 60, 0.95);
  color: white;
  padding: 9px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  max-width: 90%;
  /* min-width: 280px; */
  z-index: 2000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-size: 14px;
  font-weight: 500;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
}

.app-toast.show {
  opacity: 1;
}

.app-toast.top {
  top: 30px;
  animation: app-toastSlideInTop 0.5s forwards;
}

.app-toast.bottom {
  bottom: 30px;
  animation: app-toastSlideInBottom 0.5s forwards;
}

.app-toast i {
  margin-right: 15px;
  font-size: 1.4rem;
}

/* @keyframes app-toastSlideInTop {
  from { top: -100px; opacity: 0; }
  to { top: 30px; opacity: 1; }
} */
@keyframes app-toastSlideInTop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* @keyframes app-toastSlideInBottom {
  from { bottom: -100px; opacity: 0; }
  to { bottom: 30px; opacity: 1; }
} */

@keyframes app-toastSlideInBottom {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 列表 */
.app-list {
  background-color: #fff;
}
.app-list-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.app-list-item .app-left img {
  width: 80px;
  height: 80px;
  margin-right: 10px;
}

/* 卡片组件 */
.app-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
}

.app-card-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}

.app-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.app-card-body {
  padding: 20px;
}

.app-card-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.app-card-text {
  color: #666;
  line-height: 1.6;
}

.app-card-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
}

.app-badge-wrapper{
  display: inline-block;
  position: relative;
}
.app-badge-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background-color: #ff4444;
  color: white;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  position: absolute;
  top: -4px;
  right: -4px;
  box-shadow: 0 0 0 1px white;
  line-height: 1;
}

.app-badge-number.small {
  min-width: 14px;
  height: 14px;
  font-size: 10px;
}

.app-badge-number.primary {
  background-color: #007bff;
}

.app-badge-number.success {
  background-color: #4CAF50;
}

.app-badge-number.warning {
  background-color: #FF9800;
}
.app-badge-wrapper {
  padding: 1px;
}
/*徐竣豪 End*/

